<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a>商品管理</a></li>
			<li><a href="{:url('Goods/add')}">商品添加</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('Goods/index')}">
            <input type="text" class="form-control" name="name" style="width: 150px;" value="{:input('request.name','')}" placeholder="请输入商品名称">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="50">ID</th>
					<th>商品封面</th>
					<th>商品名称</th>
					<th>商品图片</th>
					<th>跳转链接</th>
					<th>类型</th>
					<th>状态</th>
					<th>上架时间</th>
					<th>修改时间</th>
					<th width="140">操作</th>
				</tr>
			</thead>
			<tbody>
				<php>$user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));</php>
				<foreach name="Goods" item="vo">
				<tr>
					<td>{$vo.id}</td>
					<td><img class="img-thumbnail" onclick="imagePreviewDialog(this.src)" width="50px" src="/upload/{$vo.image}"></td>
					<td>{$vo.name}</td>
					<td>
						<foreach name="$vo['images']" item="img">
							<img class="img-thumbnail" onclick="imagePreviewDialog(this.src)" width="50px" src="/upload/{$img}">
						</foreach>
						</td>
					<td>{$vo.url}</td>
					<td>{$vo.type}</td>
					<td>
						<if condition="$vo.switch == 0">
							无货
						</if>
						<if condition="$vo.switch == 1">
							正常
						</if>
						<if condition="$vo.switch == 2">
							下架
						</if>

					</td>
					<td>{$vo.create_time}</td>
					<td>{$vo.update_time}</td>
                    <td width="180px">
						<a class="btn btn-xs btn-primary" href="javascript:void(0);" onclick="openIframeLayer('getAttrVal?id={$vo.id}','配置商品属性',{area:['60%','80%']})">商品属性配置</a>
<!--						<div class="btn-group" role="group">-->
<!--							<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">-->
<!--								商品配置<span class="caret"></span>-->
<!--							</button>-->
<!--							<ul class="dropdown-menu">-->
<!--								<li>-->
<!--									<a href="javascript:void(0);" onclick="openIframeLayer('addAttr?id={$vo.id}','配置商品属性',{area:['60%','80%']})">配置属性</a>-->
<!--								</li>-->
<!--								<li>-->
<!--									<a href="javascript:void(0);" onclick="openIframeLayer('addAttrVal?id={$vo.id}','配置商品属性值',{area:['60%','80%']})">配置商品属性值</a>-->
<!--								</li>-->
<!--							</ul>-->
<!--						</div>-->
                        <a class="btn btn-xs btn-primary" href='{:url("Goods/edit",["id" => $vo["id"]])}'>编辑</a>

                        <a class="btn btn-xs btn-danger js-ajax-delete" href='{:url("Goods/del",["id" => $vo["id"]])}'>删除</a>


					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div style="width: 100%;display: flex;justify-content: center;" class="pagination">{$Goods->render()}</div>
		<div>共有 {$Goods->total()} 条数据，每页显示 {$Goods->listRows()} 条，当前第 {$Goods->currentPage()} 页，共 {$Goods->lastPage()} 页。</div>

	</div>
	<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
</body>
</html>
